package com.p2p.front.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.p2p.base.model.Money;
import com.p2p.base.page.PageVo;
import com.p2p.front.dal.model.LoanInfo;
import com.p2p.front.dal.model.Tender;
import com.p2p.front.dal.model.TenderReturn;
import com.p2p.front.result.TenderReturnResult;

public interface TenderReturnService {

	void create(TenderReturn tenerReturn);
	
	void create(Tender tender,LoanInfo loanInfo);
	
	void batchCreate(List<Tender> tenderList,LoanInfo loanInfo);
	
	
	int batchDeleteByIdList(List<Long> idList);
	
	List<TenderReturn> queryByUserCondition(TenderReturn queryCondition);
	
	List<TenderReturn> queryByDate(Date date,Integer isFlow);
	List<TenderReturn> queryByLidAndNo(Long lid,Integer no);
	
	List<TenderReturn> queryByLidAndNoAndStatus(Long lid,Integer no,Integer status);
	/*boolean updateStatus(Long id,Integer oldStatu,Integer status);*/
	
	public boolean updateStatusFromReturn(Long id);
	
	boolean updateStatusForReturn(Long id,Integer returnType,Money extraInterest);

	PageVo listPage(PageVo form);

	PageVo listPageRecycled(PageVo form);
	
	long getEarnings(Date lastUpdateTime);

	Long getDayEarnings(Date dateBegin, Date dateEnd);

	PageVo queryByTime(PageVo form, long beginTime, long endTime);
	
	public TenderReturnResult doReturn(TenderReturn tenderReturn,Boolean advance,LoanInfo loanInfo,Date now);

	List<Map<String,Object>> listAll(Integer uid);

	PageVo canPublishListPage(Long uid, PageVo form);

}
